package bancosys.tec.rtm.impl.exception.domain;

import bancosys.tec.persist.builders.AbstractDBBuilder;
import bancosys.tec.utils.date.Timestamp;

public class ExceptionRecordBuilder extends AbstractDBBuilder<ExceptionRecord> {

    private Timestamp timestamp;

    private String mensagem;

    private String stack;

    private String user;

    private String system;

    public static ExceptionRecordBuilder exceptionRecord() {
        ExceptionRecordBuilder builder = new ExceptionRecordBuilder();
        builder.timestamp(new Timestamp());
        builder.message("Message");
        builder.stack("Stack");
        builder.user("User");
        builder.system("System");
        return builder;
    }

    @Override
    protected ExceptionRecord doBuild() {
        ExceptionRecord record = this.createBean();
        record.setTimestamp(timestamp);
        record.setMensagem(mensagem);
        record.setStack(stack);
        record.setUser(user);
        record.setSystem(system);
        return record;
    }

    /**
     * @param timestamp the timestamp to set
     */
    public ExceptionRecordBuilder timestamp(Timestamp timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    /**
     * @param mensagem the mensagem to set
     */
    public ExceptionRecordBuilder message(String mensagem) {
        this.mensagem = mensagem;
        return this;
    }

    /**
     * @param stack the stack to set
     */
    public ExceptionRecordBuilder stack(String stack) {
        this.stack = stack;
        return this;
    }

    /**
     * @param user the user to set
     */
    public ExceptionRecordBuilder user(String user) {
        this.user = user;
        return this;
    }

    /**
     * @param user the user to set
     */
    public ExceptionRecordBuilder system(String system) {
        this.system = system;
        return this;
    }

}
